#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct Node
{
    int number;
    int lenth;
    struct Node* next;
}Node;

typedef struct AdjList
{
    Node* list;
    int size;
    int capacity;
}AdjList;

AdjList g;

Node* BuyNode(int val, int n)
{
    Node* newnode = (Node*)malloc(sizeof(Node));
    newnode->lenth = 0;
    newnode->number = n;
    newnode->next = NULL;
}

void AddAdjNode(int i, int j, int val)
{
    Node* cur = g.list[i];
    Node* newnode = BuyNode(val, j);
    if(cur == NULL)
    {
        cur = newnode;
    }
    else
    {
        while(cur != )
    }
}

int main()
{
    int t = 0;
    scanf("%d", &t);

    while(t--)
    {
        int n = 0, m = 0;
        scanf("%d %d", &n, &m);
        g.capacity = n;
        g.size = 0;
        g.list = (Node*)malloc(sizeof(Node) * n);
        memset(g.list, 0, sizeof(g.list));
        int* visited = (int*)malloc(sizeof(int) * n);
        int k = n - 1;
        int i = 0, j = 0, val = 0;
        while(k--)
        {
            scanf("%d %d %d", &i, &j, &val);
            AddAdjNode(i, j, val);
            AddAdjNode(j, i, val);
        }
    }
    return 0;
}